package org.example;

import org.apache.ibatis.annotations.*;
import org.springframework.data.repository.query.Param;

@Mapper
public interface SupplierMapper {

    @Select("SELECT * FROM supplier WHERE name = #{name}")
    Supplier selectByName(@Param("name") String name);

    @Update("UPDATE supplier SET contact_email = #{email} WHERE id = #{id}")
    int updateContactEmailById(@Param("id") Long id, @Param("email") String email);

    @Delete("DELETE FROM supplier WHERE id = #{id}")
    int deleteById(@Param("id") Long id);

    // 添加更多自定义方法
}
